summaryrefslogtreecommitdiff
path: root/app/[lng]/evcp
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-09-15 14:41:01 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-09-15 14:41:01 +0000
commit4ee8b24cfadf47452807fa2af801385ed60ab47c (patch)
treee1d1fb029f0cf5519c517494bf9a545505c35700 /app/[lng]/evcp
parent265859d691a01cdcaaf9154f93c38765bc34df06 (diff)
(대표님) 작업사항 - rfqLast, tbeLast, pdfTron, userAuth
Diffstat (limited to 'app/[lng]/evcp')
-rw-r--r--app/[lng]/evcp/(evcp)/rfq-last/[id]/compare/page.tsx69
1 files changed, 69 insertions, 0 deletions
diff --git a/app/[lng]/evcp/(evcp)/rfq-last/[id]/compare/page.tsx b/app/[lng]/evcp/(evcp)/rfq-last/[id]/compare/page.tsx
new file mode 100644
index 00000000..097b99eb
--- /dev/null
+++ b/app/[lng]/evcp/(evcp)/rfq-last/[id]/compare/page.tsx
@@ -0,0 +1,69 @@
+import { Suspense } from "react";
+import { notFound } from "next/navigation";
+import { QuotationCompareView } from "@/lib/rfq-last/quotation-compare-view";
+import { Loader2 } from "lucide-react";
+import { getComparisonData } from "@/lib/rfq-last/compare-action";
+
+interface ComparePageProps {
+ params: {
+ id: string;
+ };
+ searchParams: {
+ vendors?: string;
+ };
+}
+
+export default async function ComparePage({
+ params,
+ searchParams
+}: ComparePageProps) {
+ const rfqId = parseInt(params.id);
+
+ console.log(rfqId,"rfqId")
+ console.log(searchParams.vendors,"searchParams.vendors")
+
+ // URL에서 벤더 ID들 파싱
+ const vendorIds = searchParams.vendors
+ ?.split(',')
+ .map(id => parseInt(id))
+ .filter(id => !isNaN(id)) || [];
+
+ if (!rfqId || vendorIds.length < 2) {
+ notFound();
+ }
+
+ // 서버에서 데이터 가져오기
+ const data = await getComparisonData(rfqId, vendorIds);
+
+ if (!data) {
+ notFound();
+ }
+
+ return (
+ <div className="container mx-auto p-6 space-y-6">
+ {/* 페이지 헤더 */}
+ <div className="flex items-center justify-between">
+ <div>
+ <h1 className="text-2xl font-bold">견적 비교</h1>
+ <p className="text-muted-foreground">
+ {data.rfqInfo.rfqCode} - {data.rfqInfo.rfqTitle}
+ </p>
+ </div>
+ <div className="text-sm text-muted-foreground">
+ 비교 업체: {data.vendors.length}개
+ </div>
+ </div>
+
+ {/* 비교 뷰 컴포넌트 */}
+ <Suspense
+ fallback={
+ <div className="flex items-center justify-center h-64">
+ <Loader2 className="h-8 w-8 animate-spin" />
+ </div>
+ }
+ >
+ <QuotationCompareView data={data} />
+ </Suspense>
+ </div>
+ );
+} \ No newline at end of file